
import java.util.Scanner;


/**
 * @author Difan Zhao
 */
public class BuildMuscle implements Build {
    /**
     * build the object.
     * @param line is a scanner that receives user input
     * @param sim is the simulation where object is created
     *        create material object according to user input
     */
    @Override
    public final void build (Scanner line, Simulation sim) {
        int m1 = line.nextInt();
        int m2 = line.nextInt();
        double restLength = line.nextDouble();
        double ks = line.nextDouble();
        double am = line.nextDouble();
        Mass start = sim.getMass(m1);
        Mass end = sim.getMass(m2);
        sim.add(new Muscle(start, end, restLength, ks, am));
    }
}
